﻿<div class="navbar navbar-inverse navbar-fixed-m">

        <div class="navbar-inner">
            <div class="container">
                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
                <a class="brand" href="~/Home">El Enchufe</a>
                <div class="nav-collapse">
                    <ul class="nav">
                        <li class="">
                            <a href="~/Producto">Productos</a>
                        </li>
                        @if (Request.IsAuthenticated)
                        {
                            <text>
                            Hola, @Html.ActionLink(User.Identity.Name, "Manage", "Account", routeValues: null, htmlAttributes: new { @class = "username", title = "Manage" })!
                             @using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm" }))
                             {
                              @Html.AntiForgeryToken()
                           <a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
                             }
                            </text>
                        }
                        else
                        {
                            <li class="">
                               @Html.ActionLink("Registrarse", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })
                            </li>
                            <li class="">
                                @Html.ActionLink("Loguearse", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })
                            </li>                    
}
                    </ul>
                </div>
            </div>
        </div>
    </div>